<template>
  <div>
    孙子组件：{{ value }}
    <button @click="change">改变父组件的值</button>
    <Lastson1 :value="value" @say="say"></Lastson1>
  </div>
</template>

<script>
import Lastson1 from './Lastson1'

export default {
  name: 'Grandson1',
  props: {
    value: {
      type: Number,
      default: 1
    }
  },
  components: {
    Lastson1
  },
  methods: {
    change () {
      // this.$parent.$emit('changeMoney', 400)
      // this.$parent.$parent.change(400)
      this.$dispatch('changeMoney', 500)
    },
    say(message) {
      console.log(message)
    }
  }
}
</script>

<style>

</style>